"""
@ProjectName : Game
@File        : people.py
@Author      : WorldWind(1772830365@qq.com)
@Address     : ChangSha - BoWeiFeng
@Date        : 2025/7/17 下午3:46
"""


class People:
    def __init__(self, role, blood):
        self.role = role  # 角色
        self.blood = blood  # 血量
        print(f'This is __init__ method. {self.get_class_name()} class startup')

    def lostBlood(self, damage):
        self.blood -= damage
        if self.blood <= 0:
            print(f'{self.role}牺牲了')

    def takeGun(self, gun):
        self.gun = gun

    # def installClip(self,clip):

    def fire(self, people):
        self.gun.shoot(people)

    @classmethod
    def get_class_name(cls):
        return cls.__name__

    def __del__(self):
        print(f'This is __del__ method. The {self.get_class_name()} class has been recycled')
